package observer;

public class BinaryObserver extends Observer {

    /**
     * 定义构造函数
     * @param subject 抽象类Observer中的subject对象
     */
    public BinaryObserver(Subject subject){
        this.subject = subject;
        this.subject.attach(this);
    }


    @Override
    public void update() {
        System.out.println("Binary String:"+Integer.toBinaryString(subject.getState()));
    }
}
